unit FrmMenu1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, ComCtrls, ToolWin, ImgList;

type
  TFrmMenu = class(TForm)
    MainMenu1: TMainMenu;
    Arquivo1: TMenuItem;
    Exebir1: TMenuItem;
    mnudbexplorer: TMenuItem;
    Sair1: TMenuItem;
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ImageList1: TImageList;
    Bases1: TMenuItem;
    mnucadastrar: TMenuItem;
    Opes1: TMenuItem;
    Opes2: TMenuItem;
    ServerStatus1: TMenuItem;
    N1: TMenuItem;
    Slony1: TMenuItem;
    Relatrios1: TMenuItem;
    abelasSlonyxTabelaBase1: TMenuItem;
    Sobre1: TMenuItem;
    Sobre2: TMenuItem;
    procedure mnudbexplorerClick(Sender: TObject);
    procedure Sair1Click(Sender: TObject);
    procedure ToolButton2Click(Sender: TObject);
    procedure mnucadastrarClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Opes2Click(Sender: TObject);
    procedure abelasSlonyxTabelaBase1Click(Sender: TObject);
    procedure Exebir1Click(Sender: TObject);
    procedure ServerStatus1Click(Sender: TObject);
    procedure Sobre2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FrmMenu: TFrmMenu;

implementation

uses FrmExplorer1, FrmCadastrarBase1, FrmConfiguracoes1,
  FrmTabelasSlonyBase1, FrmServerStatus1, FrmSobre1;

{$R *.dfm}

procedure TFrmMenu.mnudbexplorerClick(Sender: TObject);
begin
  if (not mnudbexplorer.Checked) and
     (Assigned (FrmExplorer)) then
    FreeAndNil(FrmExplorer)
  else
    if (not Assigned (FrmExplorer)) then
    begin
      FrmExplorer := TFrmExplorer.Create(nil);
      FrmExplorer.Show;
    end;
end;

procedure TFrmMenu.Sair1Click(Sender: TObject);
begin
  Close;
end;

procedure TFrmMenu.ToolButton2Click(Sender: TObject);
begin
  mnucadastrar.Click;
end;

procedure TFrmMenu.mnucadastrarClick(Sender: TObject);
begin
  FrmCadastrarBase := TFrmCadastrarBase.Create(nil);
  FrmCadastrarBase.ShowModal;
end;

procedure TFrmMenu.FormCreate(Sender: TObject);
begin
  mnudbexplorer.Click;
end;

procedure TFrmMenu.Opes2Click(Sender: TObject);
begin
  FrmConfiguracoes := TFrmConfiguracoes.Create(nil);
  FrmConfiguracoes.ShowModal;
end;

procedure TFrmMenu.abelasSlonyxTabelaBase1Click(Sender: TObject);
begin
  FrmTabelasSlonyBase := TFrmTabelasSlonyBase.Create(nil);
  FrmTabelasSlonyBase.ShowModal;
end;

procedure TFrmMenu.Exebir1Click(Sender: TObject);
begin
  mnudbexplorer.Checked := Assigned (FrmExplorer);
end;

procedure TFrmMenu.ServerStatus1Click(Sender: TObject);
begin
  FrmServerStatus := TFrmServerStatus.Create(nil);
  FrmServerStatus.Show;
end;

procedure TFrmMenu.Sobre2Click(Sender: TObject);
begin
  FrmSobre := TFrmSobre.Create(Application);
  FrmSobre.ShowModal;
end;

end.
